using MinoChat.Ui.Enums;
using System.Globalization;
using System.Windows.Data;

namespace MinoChat.Ui.Converters;

public class EnumTypeToImageConverter : IValueConverter
{
    public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
    {
        if (value is ImageType type)
        {
            return type switch
            {
                ImageType.Success => "/MinoChat.Ui;component/Resources/Images/success.png",
                ImageType.Error => "/MinoChat.Ui;component/Resources/Images/error.png",
                ImageType.Warning => "/MinoChat.Ui;component/Resources/Images/warning.png",
                ImageType.Info => "/MinoChat.Ui;component/Resources/Images/info.png",
                _ => "/MinoChat.Ui;component/Resources/Images/info.png"
            };
        }
        return "/MinoChat.Ui;component/Resources/Images/info.png";
    }

    public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
    {
        throw new NotImplementedException();
    }
}
